﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.IO;
using Microsoft.Win32;

namespace Feniks
{
    static class Program
    {
        public static DevExpress.LookAndFeel.DefaultLookAndFeel look = new DevExpress.LookAndFeel.DefaultLookAndFeel();
        public static Sessions Session = null;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Session = Sessions.CreateSession;
            try
            {
                Registry.ClassesRoot.CreateSubKey("Microsoft.Workflow").CreateSubKey("CLSID");
            }
            catch (Exception)
            {
            }

            Controller lic = new Controller();
            if (!lic.CheckEvaluate())
            {
                return;
            }

            look.LookAndFeel.SkinName = "Black";
            DevExpress.Skins.SkinManager.EnableFormSkins();
            DevExpress.UserSkins.BonusSkins.Register();

            if (!File.Exists(Application.StartupPath + "\\ayarlar.ini"))
            {
                frmAyarlar ayar = new frmAyarlar();
                if (ayar.ShowDialog() == DialogResult.OK)
                    Application.Exit();
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new frmMain());
            }
            Session.CloseSession();
        }
    }
}
